package com.ming.dao;

import com.ming.po.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserDao {

	@Select("select * from user where userId=#{userId} and password=#{password}")
	User getUserByIdByPass(User user);

	@Select("select * from user where userId = #{userId}")
	User getUserById(String userId);

	@Insert("INSERT INTO `user`(`userId`,`password`,`userName`,`userSex`,`delTag`) " +
			"VALUES (#{userId},#{password},#{userName},#{userSex},1);")
	int saveUser(User user);

	@Update("update user set userImg = #{userImg} where userId = #{userId}")
	int updateUserImg(User user);

	@Update("update user set password = #{password} where userId = #{userId}")
	int updatePwd(User user);
}
